Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
miller-rabin
Advanced tools
The miller-rabin npm package is a JavaScript implementation of the Miller-Rabin probabilistic primality test. This package is used to determine whether a given number is a probable prime. It is particularly useful in cryptographic applications where large prime numbers are required.
Primality Testing
This feature allows users to test if a number is a probable prime using the Miller-Rabin test. The example shows how to test if the number 17 is a probable prime.
const MillerRabin = require('miller-rabin');
const mr = new MillerRabin();
const probablePrime = mr.test(BigInt(17));
console.log(probablePrime); // outputs true
The 'bignum' package provides arbitrary-precision arithmetic operations, including primality testing. It offers similar functionality for primality testing but also includes a broader range of arithmetic operations, making it more versatile than miller-rabin.
The 'prime-number' package is another tool for checking the primality of numbers. Unlike miller-rabin, which uses a probabilistic test, 'prime-number' uses deterministic tests for smaller numbers and switches to probabilistic tests for larger numbers, potentially offering a different balance of performance and accuracy.
This software is licensed under the MIT License.
Copyright Fedor Indutny, 2014.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Miller Rabin algorithm for primality test
The npm package miller-rabin receives a total of 6,374,784 weekly downloads. As such, miller-rabin popularity was classified as popular.
We found that miller-rabin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.